<template>
  <div :id="idRe" v-bind="selfAttr">{{ count }}</div>
  <div>
    <button @click="count++">点我</button>
    <button @click="click(1)">点我1</button>
    <button @click="click(2)">点我2</button>
  </div>
</template>

<script lang="ts">
import { ref } from "vue";

export default {
  name: "appIndex",
  setup() {
    const count = ref(0);
    const idRe = ref(Math.random());
    const selfAttr = ref({
      class: "selfClass",
    });
    const click = (num: number) => {
      count.value += num;
      console.log(num);
    };
    return {
      count,
      idRe,
      selfAttr,
      click,
    };
  },
};
</script>

<style scoped>
.selfClass {
  color: red;
}
</style>
